<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: attribut_manager.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */
?>
<table width="100%">
	<tr>
		<td width="50%">
			<button type="button" class="button" onclick="dialogBox('ajax_dispatcher.php?modul=attr_manager&do=new_attribut&pid=<?php echo $pInfo->products_id ?>', 300, 150, 'Attribut anlegen')">
				Attribut anlegen
			</button>
		</td>
		<td align="right">
			<button type="button" class="button" onclick="dialogBox('ajax_dispatcher.php?modul=attr_manager&do=new_option', 500, 250, 'Option anlegen')">
				Option anlegen
			</button>
			<button type="button" class="button" onclick="dialogBox('ajax_dispatcher.php?modul=attr_manager&do=new_value', 500, 250, 'Optionswert anlegen')">
				Optionswert anlegen
			</button>
		</td>
	</tr>
</table>
<div id="attributes"></div>

<script type="text/javascript">
	function dialogBox(url, w, h, title, save) {
		if(save == 'true') {
			var extra_button = {"<?php echo BUTTON_SAVE ?>":function(){$("#dialog_form").submit();},"<?php echo BUTTON_CANCEL ?>": function() {$(this).dialog("close");}};
		} else {var extra_button = '';}
		
        var dialog = $('<div class="dialog-box" style="display:none" class="loading"></div>').appendTo('body');
        
        dialog.dialog({
            close: function(event, ui) {dialog.remove();},
            modal: true,
            title: title,
            buttons: extra_button,
            width: w > 0 ? w : 500,
            height: h > 0 ? h : 250
        });
        dialog.load(url,{},function (responseText, textStatus, XMLHttpRequest){
        	dialog.removeClass('loading');
        	$('.ui-dialog-content').css({backgroundImage:'none'});
        });
		return false;
	}
</script>